package com.qys.livesMall.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qys.livesMall.shop.constants.PayStatus;
import com.qys.livesMall.shop.mapper.SeckillOrderMapper;
import com.qys.livesMall.shop.modal.entity.SeckillOrder;
import com.qys.livesMall.shop.service.SeckillOrderService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author gmx
 * @since 2023-07-03
 */
@Service
public class SeckillOrderServiceImpl extends ServiceImpl<SeckillOrderMapper, SeckillOrder> implements SeckillOrderService {



    @Override
    public List<SeckillOrder> queryByActivitId(Long activitId) {
        LambdaQueryWrapper<SeckillOrder> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SeckillOrder::getSeckillActivityId,activitId);
        queryWrapper.eq(SeckillOrder::getStatus, PayStatus.HAVE_PAYMENT);
        return super.list(queryWrapper);
    }

}
